class TodoEntity {
  late TodoModel todoModel;
  TodoEntity({required this.todoModel});
  TodoEntity.fromJson(Map<String, dynamic> json) {
    if (json['code'] != null) {
      todoModel = TodoModel.fromJson(json);
    }
  }
}

class TodoListEntity {
  late List<TodoModel> todos;

  TodoListEntity({required this.todos});

  TodoListEntity.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      todos = [
        ...(json['data'] as List? ?? []).map((o) => TodoModel.fromJson(o))
      ];
    }
  }
}

class TodoModel {
  String? createBy;
  DateTime? createTime;
  DateTime? updateTime;
  String? remark;
  int? todoId;
  String? title;
  String? content;
  String? type;
  String? todoDate;
  String? tags;
  String? startTime;
  String? endTime;
  DateTime? remindTime;
  bool? isRemind;
  int? level;
  int? sort;
  bool? itemStatus;
  String? status;
  bool? delFlag;

  TodoModel(
      {this.createBy,
      this.createTime,
      this.updateTime,
      this.remark,
      this.todoId,
      this.title,
      this.content,
      this.type,
      this.todoDate,
      this.tags,
      this.startTime,
      this.endTime,
      this.remindTime,
      this.isRemind,
      this.level,
      this.sort,
      this.itemStatus,
      this.status,
      this.delFlag});

  TodoModel.fromJson(Map<String, dynamic> json) {
    createBy = json['createBy'];
    createTime = json['createTime'];
    updateTime = json['updateTime'];
    remark = json['remark'];
    todoId = json['todoId'];
    title = json['title'];
    content = json['content'];
    type = json['type'];
    todoDate = json['todoDate'];
    tags = json['tags'];
    startTime = json['startTime'];
    endTime = json['endTime'];
    remindTime = json['remindTime'];
    isRemind = json['isRemind'];
    level = json['level'];
    sort = json['sort'];
    itemStatus = json['itemStatus'];
    status = json['status'];
    delFlag = json['delFlag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['createBy'] = createBy;
    data['createTime'] = createTime;
    data['updateTime'] = updateTime;
    data['remark'] = remark;
    data['todoId'] = todoId;
    data['title'] = title;
    data['content'] = content;
    data['type'] = type;
    data['todoDate'] = todoDate;
    data['tags'] = tags;
    data['startTime'] = startTime;
    data['endTime'] = endTime;
    data['remindTime'] = remindTime;
    data['isRemind'] = isRemind;
    data['level'] = level;
    data['sort'] = sort;
    data['itemStatus'] = itemStatus;
    data['status'] = status;
    data['delFlag'] = delFlag;
    return data;
  }
}
